package com.sne.airways.system.pojo;

import com.sne.airways.basecore.pojo.BaseProperties;
import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * Created by IntelliJ IDEA.
 * User: 李庆旭
 * Date: 11-6-20
 * Time: 下午3:31
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "SYSTEM_PROPERTIES")
@BatchSize(size=5)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class SystemProperties extends BaseProperties {
    /**
     * 主键
     */
    @Id
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid",strategy = "uuid")
    @Column(name = "ID",length = 45)
    private String id;
    /**
     * 属性键
     */
    @Column(name = "KEY",length = 100)
    private String key;
    /**
     * 属性值
     */
    @Column(name = "VALUE",length = 300)
    private String value;
    /**
     * 描述
     */
    @Column(name = "REMARK",length = 500)
    private String remark;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof SystemProperties)) return false;

        SystemProperties systemProterties = (SystemProperties) o;

        if (id != null ? !id.equals(systemProterties.id) : systemProterties.id != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }
}
